<template>
  <div class="big-box">
    <Top></Top>
    <Banner id="1"></Banner>
    <chamber></chamber>
    <div class="war">
      <div class="area-center">
        <!-- 商机总区域 -->
        <div class="top">
          <!-- 商机区域 -->
          <Head title="商 机" style="border-bottom: none"> </Head>
          <!-- 用户单位文字区域 -->
          <div class="umit title-center">
            <div
              class="xiao m-t-07"
              v-for="(item, index) in list"
              :key="index"
              @click="business(item)"
            >
              <div class="left">
                <div class="yuan"></div>
              </div>
              <div class="zhong">
                {{ item.businessTitle }}
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <Tabbar></Tabbar>
  </div>
</template>

<script>
import Top from "../../components/Home/TopPage.vue";
import Banner from "@/components/Home/BannerView.vue";
import chamber from "@/components/Home/CommCe.vue";
import Head from "@/components/public/HeadPage.vue";
import Tabbar from "@/components/public/TabbleView.vue";
import { getBusinessproUrl } from "@/api/index";
export default {
  data() {
    return {
      list: [],
    };
  },
  components: {
    Top,
    Banner,
    chamber,
    Head,
    Tabbar,
  },
  methods: {
    business(item) {
      if (
        [
          "57f93baf-975d-414b-a170-ac66c2a22277",
          "f7a84efa-274a-49de-8bf4-b30fd66cfd61",
        ].includes(item.businessId)
      ) {
        this.$router.push({
          path: "/businessone",
          query: {
            id: item.businessId,
            title: item.businessTitle,
          },
        });
      } else {
        this.$router.push({
          name: "businessdetail",
          query: {
            id: item.businessId,
            title: item.businessTitle,
          },
        });
      }
      // if (!item.businessUrl) {
      // 	this.$router.push({
      // 		path: "/businessone",
      // 		query: {
      // 			id: item.businessId,
      // 			title: item.businessTitle
      // 		}
      // 	})
      // } else {
      // 	this.$router.push({
      // 		path: "/businessfour",
      // 		query: {
      // 			id: item.businessId,
      // 			title: item.businessTitle
      // 		}
      // 	})
      // }
    },
  },
  //底部栏的高亮
  created() {
    sessionStorage.setItem("active", 1),
      getBusinessproUrl().then((res) => {
        if (res.data.code == 200) {
          this.list = res.data.rows;
        }
      });
  },
};
</script>

<style scoped>
.big-box {
  width: 100%;
}

/* 商机总区域 */
.top {
  width: 100%;
}
/* 图标区域 */

/* 用人单位区域 */
.umit {
  width: 100%;
  min-height: 0.4rem;
}
.xiao {
  width: 100%;
  display: flex;
  align-items: center;
}
/* 左边区域 */

.left {
  width: 5%;
  margin-right: 0.07rem;
}
.yuan {
  width: 0.18rem;
  height: 0.18rem;
  border-radius: 50%;
  margin-top:-.03rem ;
  background-color: black;
}
/* 中间区域 */
.zhong {
  width: 95%;
  height: 100%;
}
/* 底部区域 */
.bottom {
  width: 100%;
  height: 100%;
  margin-top: 0.1rem;
}

.bottom h3 {
  width: 100%;
  height: 0.35rem;
  text-align: center;
}
/* 内容区域 */
.context {
  width: 100%;
  height: 1rem;
  font-weight: 700;
}
</style>